Skip to content

feat(codex): add account picker visibility setting - #1096

Merged
Wibias merged 1 commit into
lidge-jun:devfrom
chrisae9:split/1019-01-picker-setting
Aug 6, 2026
Merged

feat(codex): add account picker visibility setting#1096
Wibias merged 1 commit into
lidge-jun:devfrom
chrisae9:split/1019-01-picker-setting

Conversation

@chrisae9

@chrisae9 chrisae9 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add the optional codexAccountPickerEnabled config field without changing fresh defaults
  • preserve the existing behavior implied by a non-empty hand-written selector map when the field is omitted
  • degrade malformed persisted values to false without discarding providers, accounts, or selector bindings
  • reject malformed, inherited, or accessor-backed live values without invoking getters
  • keep exact account-qualified routing independent from picker visibility

This is the first slice from #1019 after the requested split. It intentionally establishes only the setting contract and pure default resolver. Selector initialization, catalog convergence, and management API/dashboard behavior follow in separate PRs after their dependencies land.

Part of #425.

Verification

  • rebased onto dev@e9d957bf
  • feature suite: 197 passed (config, namespace, router, and Codex injection coverage)
  • latest upstream delta: corrected composed-acceptance suite 6 passed; the preceding integration suites passed 228 tests
  • bun run typecheck
  • bun run privacy:scan
  • bun test tests/repo-hygiene.test.ts
  • node --test .github/scripts/pr-sponsored-surface.test.cjs
  • git diff --check upstream/dev...HEAD
  • canonical full-suite run on the preceding rebased head: 9,226 passed, 10 skipped, with one unrelated order-dependent native-profile test failure; that complete test file passes 3/3 in isolation. Exact-head GitHub CI is pending.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • New Features

    • Added an optional setting to control visibility of account-qualified Codex models.
    • Existing account selector configurations remain visible by default for compatibility.
    • Account-qualified models continue routing to the configured Codex account and namespace when the picker is hidden.
  • Bug Fixes

    • Invalid configuration values now fail safely, preserve other settings, and provide warnings.
    • Configuration validation rejects non-boolean picker values and malformed configuration entries.
    • Improved handling of configuration updates to prevent invalid picker settings from being saved.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change adds optional codexAccountPickerEnabled support. Populated namespace maps remain enabled by default. Explicit false hides picker rows. Malformed persisted values fail closed. Account-qualified routing remains unchanged.

Changes

Account picker control

Layer / File(s) Summary
Picker visibility contract
src/types.ts, src/codex/account-namespaces.ts, tests/codex-account-namespaces.test.ts
OcxConfig adds the optional flag. codexAccountPickerEnabled enables picker rows when the flag is unset or true and the namespace map is populated. Tests cover overrides, empty maps, missing maps, and malformed values.
Configuration persistence and validation
src/config.ts, tests/config.test.ts
Config parsing converts malformed persisted values to false and emits warnings and diagnostics. Candidate validation accepts omission or undefined. It rejects invalid, inherited, and accessor properties.
Routing behavior verification
tests/router.test.ts
Routing preserves the OpenAI provider, model ID, account ID, namespace, pool mode, and forwarded authentication when picker visibility is disabled.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Config
  participant codexAccountPickerEnabled
  participant AccountQualifiedCatalog
  participant ConfiguredCodexAccount
  Config->>codexAccountPickerEnabled: Provide picker flag and namespace map
  codexAccountPickerEnabled-->>AccountQualifiedCatalog: Return picker visibility
  AccountQualifiedCatalog->>ConfiguredCodexAccount: Route account-qualified native model
  ConfiguredCodexAccount-->>AccountQualifiedCatalog: Preserve account, namespace, and authentication
Loading

Possibly related PRs

Suggested reviewers: wibias, lidge-jun

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: adding a Codex account picker visibility setting.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 6, 2026
@github-actions
github-actions Bot marked this pull request as ready for review August 6, 2026 02:53

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7953272eca

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/codex/account-namespaces.ts
Comment thread src/types.ts
@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 03:28
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from 7953272 to de6e0aa Compare August 6, 2026 03:29
@github-actions
github-actions Bot marked this pull request as ready for review August 6, 2026 03:48
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/router.test.ts`:
- Around line 134-140: Expand the assertion for routeModel when
codexAccountPickerEnabled is false to also verify codexAccountMode is "pool" and
provider.authMode is "forward", preserving the existing provider, model, account
ID, and namespace checks.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 39991cf9-2ce1-462c-b975-6447b6690682

📥 Commits

Reviewing files that changed from the base of the PR and between 7425855 and de6e0aa.

📒 Files selected for processing (6)
  • src/codex/account-namespaces.ts
  • src/config.ts
  • src/types.ts
  • tests/codex-account-namespaces.test.ts
  • tests/config.test.ts
  • tests/router.test.ts

Comment thread tests/router.test.ts
@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 03:50
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from de6e0aa to ce32336 Compare August 6, 2026 04:07
@github-actions
github-actions Bot marked this pull request as ready for review August 6, 2026 04:08
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 04:18
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from ce32336 to e62ff78 Compare August 6, 2026 05:02
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ All CI tests are green on my local testing.
  • ✅ I pushed my PR to the latest dev commit.
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

4/4 boxes ticked.

This pull request is already Ready for Review.
CodeRabbit/Codex review was requested via the review-ready label. If no review appears, comment @coderabbitai review to request one.
Maintainers: @lidge-jun @Ingwannu @Wibias

@github-actions
github-actions Bot marked this pull request as ready for review August 6, 2026 05:05
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The pull request is marked ready. I will review the changes.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The pull request is ready for review. I will review the changes.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 05:15
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from e62ff78 to a44af1f Compare August 6, 2026 05:18
@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 11:43
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from 8dc3722 to 283fc83 Compare August 6, 2026 11:44
@chrisae9
chrisae9 marked this pull request as ready for review August 6, 2026 11:45
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness checklist is complete. I will review pull request #1096.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness checklist is complete. I will review pull request #1096.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 13:19
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from 283fc83 to c37dc5a Compare August 6, 2026 13:21
@chrisae9
chrisae9 marked this pull request as ready for review August 6, 2026 13:22
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions The readiness checklist is complete. I will review pull request #1096.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions The readiness checklist is complete. I will review pull request #1096.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 13:58
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from c37dc5a to 435ade0 Compare August 6, 2026 13:59
@chrisae9
chrisae9 marked this pull request as ready for review August 6, 2026 14:00
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness checklist is complete. I will review pull request #1096.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions The readiness checklist is complete. I will review pull request #1096.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Wibias

Wibias commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

[GD] Verdict: changes-requested

TLDR

  • PR: feat(codex): add account picker visibility setting #1096 — feat(codex): add account picker visibility setting
  • Head: 435ade0 on dev (mergeStateStatus: CLEAN)
  • Decision: useful foundation slice; clean on bug/security/spec/standards and reviews; blocked on required CI not having run on this head (queued awaiting fork-PR workflow approval — owner action)
  • Usefulness: delivers the declared first slice of feat(codex): add account picker lifecycle settings #1019/Expose Codex accounts as model namespaces in the picker #425 — a dormant codexAccountPickerEnabled setting contract + pure resolver, no user-visible behavior yet (declared non-goal)
  • Bugs: none blocking
  • Security: none confirmed (privacy scan passes; secrets scan finds only pre-existing test fixtures)
  • Spec / standards: clean — matches repo degrade-don't-destroy config pattern; non-goals honored (catalog wiring + docs deferred to consuming slices)
  • Reviews: CodeRabbit finding fixed on head and confirmed addressed; Codex P2s answered with scoped-slice rationale (durable declines); owner @Ingwannu reviewed an earlier head 62f33d7e, no code blocker, waiting on CI
  • Base / CI: up to date with dev@e9d957bf; owner action: approve/run the Cross-platform CI workflow on head 435ade0 — it is queued awaiting fork-PR approval and has not produced a ci result (foreign PR, cannot approve from here)
  • Gate: none (not draft/WIP); required CI incomplete is the blocker
  • Owner actions (foreign PR): (1) approve and let the Cross-platform CI workflow run to completion on head 435ade0; (2) no simplification candidates worth applying (see full verdict)
  • Bottom line: This is a small, honest, well-tested contract slice with no code-level blockers. It should land once the repository ci suite actually runs green on this head. The single open item is a CI-run approval, not a code change.
Full verdict

Semantic propagation

  • Concepts audited: codexAccountPickerEnabled (new optional config boolean + visibility resolver)
  • Authoritative sources: src/types.ts (OcxConfig.codexAccountPickerEnabled doc) + src/config.ts (configSchema entry) — the schema is the persistence contract; getDefaultConfig() intentionally omits the key
  • Producers and consumers checked: producers = loadConfig / configDiagnosticsFromRaw (persisted) and validateConfigCandidate (live writes); consumers = none yet by design (dormant resolver, src/codex/account-namespaces.ts codexAccountPickerEnabled); repo-wide rg confirms no production consumer — consistent with the declared non-goal
  • Public/derived representations checked: persisted config.json key; getDefaultConfig() absence; warning strings; no CLI/API/UI/dashboard surface in this slice
  • Material variant partitions checked: omitted + empty map → false; omitted + non-empty map → true; explicit true + non-empty → true; explicit false → false; malformed persisted → degrade to false; malformed/inherited/accessor live values → rejected without invoking getters
  • Positive and negative assertions checked: all quadrants covered in tests/codex-account-namespaces.test.ts; round-trip + fail-closed + warning in tests/config.test.ts; routing independence in tests/router.test.ts (incl. codexAccountMode: "pool" and provider.authMode: "forward")
  • Unmapped surfaces: none — no other representation of the new key exists in the repo
  • Unproven equivalence assumptions: none
  • Representation mismatches: none
  • Variant coverage gaps: none
  • Axis verdict: pass

Linked: #1019 (split source), #425 (parent issue); none auto-closed by this PR

Usefulness

Real, well-scoped foundation slice: it establishes the setting contract and pure default resolver that the catalog-convergence and management/dashboard slices will build on, and it locks the compatibility behavior (non-empty hand-written selector map stays picker-enabled when the field is omitted). No user-visible change yet — explicitly declared and consistent with the maintainer-requested split on #1019.

Bugs / correctness

  • Method: bug-review.md — Bugbot: n/a (Codex host, complementary in-session); static: typecheck green; complementary lenses done (silent_failures, resource_leaks, edge_cases, boundary_conditions, api_compatibility, error_propagation, state_consistency, network_cancellation, parsing_serialization)
  • Findings: none blocking. Probe evidence verified via verify-probe-coverage.mjs (valid: true): input-shape-evidence-semantics clean, lock-error-propagation n/a (no lock surface), recursion-termination n/a (no resolver recursion), test-honesty clean (all new assertions non-vacuous)
  • Local tip validation (worktree at head 435ade0): bun run typecheck green; focused suite 168 pass / 6 fail — the 6 failures are pre-existing config.ts symlink tests that fail identically on base dev@e9d957bf with Windows EPERM (Developer-Mode symlink permission), not introduced by this PR; bun test tests/repo-hygiene.test.ts 11/11; bun run privacy:scan passes
  • Fixed this session: none (foreign PR — no edits)

Security

  • Scope reviewed: config schema/validation boundary, warnings/logging, no credential or outbound surface. ai-agent-security skill loaded per scope; decision tree → n/a (no MCP/tool-invocation/retrieval surface in this diff). Coverage matrix complete: authn/authz/injection/SSRF/IaC/crypto n/a (untouched); secrets/config done (privacy:scan passes, scanner hits are pre-existing test fixtures only); logging/privacy done (new warnings log only the key name + expected type, no values)
  • Findings: none confirmed
  • Fixed this session: none

Spec / standards

  • Spec source: PR body (first slice of feat(codex): add account picker lifecycle settings #1019 after requested split) + linked Expose Codex accounts as model namespaces in the picker #425; explicit non-goals (selector initialization, catalog convergence, management API/dashboard behavior, docs → later PRs)
  • Gaps: none. Every declared requirement is implemented and tested: field optional without fresh defaults; non-empty hand-written map stays enabled when omitted; malformed persisted values degrade to false without discarding providers/accounts/selectors; malformed/inherited/accessor live values rejected without invoking getters; exact account-qualified routing independent of picker visibility
  • Standards: follows the repo's established degrade-don't-destroy pattern (codexAccountPriorities, claudeSubagentEffort, native-subagent fields), JSDoc on new public declarations, tests next to subsystem. No code smells worth acting on — the new helpers mirror the existing warning/degrade convention intentionally

Reviews

  • Owners/maintainers: @Ingwannu reviewed head 62f33d7e — no code-level blocker; waiting on the repository ci check for head 435ade0. Informational, no code change requested; carried as the CI owner action below
  • Bots: CodeRabbit actionable finding (assert full routing contract in the disabled-picker router test) fixed on head and confirmed addressed by CodeRabbit; Codex P2s (flag not wired into catalog yet; docs not updated) answered by the author with scoped-slice rationale — durable declines consistent with the declared non-goals

Base / CI

  • Behind/conflicts: clean — head 435ade0 is exactly 1 commit ahead of dev@e9d957bf (current base), mergeable
  • Required checks: enforce-target, label, hygiene, CodeRabbit green on head. Cross-platform CI (ci) and React Doctor runs are queued awaiting fork-PR workflow approval (first-time contributor; repo approval policy) — no ci check result exists on this head. GitHub shows mergeStateStatus: CLEAN only because no branch-protection/ruleset marks ci as required; the repository convention and the owner's review treat it as required
  • Local tip compile/tests: typecheck + focused suite green (168 pass; 6 pre-existing Windows symlink failures reproduced on base)

Simplification (for the PR owner)

Simplify was explicitly requested. Bounded candidate pass complete — no edits made (foreign PR). Findings:

  • No meaningful behavior-preserving simplifications worth applying. The PR is already minimal (177 insertions across 6 files) and its structure intentionally mirrors the repo's established degrade-pattern convention for optional config fields (codexAccountPriorities, claudeSubagentEffort, native-subagent fields): schema .catch() + load-time warning + live-write rejection + pure resolver. Collapsing those layers would diverge from the repo convention, not simplify it.
  • The one marginal candidate: in tests/codex-account-namespaces.test.ts, the malformed-value loop [null, "false", 0, {}, []] tests resolver inputs the typed schema can never produce. Trimming to the schema-reachable values would reduce noise slightly, but the assertions are harmless and defensive. Optional, not recommended.

Gate

none (not draft/WIP/do-not-merge). The blocker is required-CI incompleteness (queued approval), which on this foreign PR is an owner action.

Bottom line

This is a small, honest, well-tested contract slice with no code-level blockers on bug/security/spec/standards or review threads. It should land once the repository ci suite runs green on head 435ade0. The single open item is a maintainer approving the queued Cross-platform CI workflow run — no code change required.

@Wibias
Wibias merged commit b39eecf into lidge-jun:dev Aug 6, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants